package cn.smartorigin.soas.frame;

import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.Insets;
import java.awt.Rectangle;
import java.awt.TexturePaint;
import java.awt.image.BufferedImage;

public class SoasUtil {
	static public final Color selectionColor	= new Color(255,153,0);		//行选择颜色
	static public final Color evenRowColor 	= new Color(233,242,241);	//奇数行颜色
	static public final Color oddRowColor 	= new Color(255,255,255);	//偶数行颜色
	static public final Color gridColor 		= new Color(236,233,216);	//网格颜色
    public static final Color DEFAULT_TEXT_COLOR = new Color(37, 81, 54);
    public static final Color colunmHighRigthColor = new Color(255, 00, 00);
    
    public static final Color MENUITEM_SELECTED_BACKGROUND = new Color(166, 188, 140);
    public static final Color MENUITEM_BACKGROUND = new Color(228, 235, 218);
    
    public static final Color TAB_BOTTOM_LINE_COLOR = new Color(167, 173, 175);

    public static final Font FONT_14_BOLD = new Font("宋体", Font.BOLD, 14);
    public static final Font FONT_12_BOLD = new Font("宋体", Font.BOLD, 12);
    
    public static final Font FONT_14_PLAIN = new Font("Calibri", Font.PLAIN, 14);
    public static final Font FONT_12_PLAIN = new Font("Calibri", Font.PLAIN, 12);
    
    public static final Insets ZERO_INSETS = new Insets(0, 0, 0, 0);
    
    /**
     * 使用自定义图像生成一个用于填充的画笔
     * @param image	自定义图像
     * @return
     */
    public static TexturePaint createTexturePaint(Image image) {
        int imageWidth = image.getWidth(null);
        int imageHeight = image.getHeight(null);
        
        BufferedImage bi = new BufferedImage(imageWidth, imageHeight, BufferedImage.TYPE_INT_ARGB);
        Graphics2D g2d = bi.createGraphics();
        g2d.drawImage(image, 0, 0, null);
        g2d.dispose();
        
        return new TexturePaint(bi, new Rectangle(0, 0, imageWidth, imageHeight));
    }
    
    static public class TreeNodeData{
    	public String treeNodeName;
    	public int treeNodeUsrId;
    	
    	public TreeNodeData(){
    		
    	}
    }
}
